package com.stylefeng.guns.common.exception;

import com.stylefeng.guns.core.exception.ServiceExceptionEnum;

/**
 * @author fengshuonan
 * @Description 所有业务异常的枚举
 * @date 2016年11月12日 下午5:04:51
 */
public enum BizExceptionEnum implements ServiceExceptionEnum {

    /**
     * 系统设置
     */
    AREA_ADDNULLPOINTE(3001, "区域设置增加没有数据"),
    AREA_UPDATENULLPOINTE(3002, "区域设置修改没有数据"),
    DICT_DM_EXISTED(3003, "字典代码重复"),
    DICT_EXISTED(3004, "字典已经存在"),
    ERROR_CREATE_DICT(3005, "创建字典失败"),
    MENU_PCODE_COINCIDENCE(3006, "菜单编号和副编号不能一致"),
    EXISTED_THE_MENU(3007, "菜单编号重复，不能添加"),
    DICT_MUST_BE_NUMBER(3008, "字典的值必须为数字"),
    NOT_DELETE_ERROR(3009, "该文章不能删除"),

    FILE_READING_ERROR(3101, "FILE_READING_ERROR!"),
    FILE_NOT_FOUND(3102, "FILE_NOT_FOUND!"),
    UPLOAD_ERROR(3103, "上传图片出错"),
    DB_RESOURCE_NULL(3201, "数据库中没有该资源"),
    NO_PERMITION(3202, "权限异常"),
    REQUEST_INVALIDATE(3203, "请求数据格式不正确"),
    INVALID_KAPTCHA(3204, "验证码不正确"),
    CANT_DELETE_ADMIN(3205, "不能删除超级管理员"),
    CANT_FREEZE_ADMIN(3206, "不能冻结超级管理员"),
    CANT_CHANGE_ADMIN(3207, "不能修改超级管理员角色"),

    REQUEST_NULL(3301, "请求有错误"),
    SESSION_TIMEOUT(3302, "会话超时"),
    USER_ALREADY_REG(3303, "该用户已经注册"),
    USER_NOT_EXISTED(3305, "没有此用户"),
    ACCOUNT_FREEZED(3306, "账号被冻结"),
    OLD_PWD_NOT_RIGHT(3307, "原密码不正确"),
    TWO_PWD_NOT_MATCH(3308, "两次输入密码不一致"),
    USER_INFO_ERROR(3309, "请核实该用户信息"),
    KAPTCHA_ERROR(3310, "验证码不正确"),


    /**
     * 公共参数
     */
    SYSTEM_ERROR(5000, "系统出现异常，请稍后再试"),
    PARAM_ERROR(1000, "请输入正确的参数"),
    SMS_SEND_ERROR(1001, "短信发送失败,请稍后重试!"),
    SEND_TIMES_ERROR(1002, "短信发送次数过于频繁,请稍后重试!"),
    SMSCODE_NOT_EXIST_ERROR(1003, "请先获取短信验证码!"),
    SMS_NOT_RIGTH_ERROR(1004, "请输入正确的短信验证码!"),
    UPLOAD_IMAGE_ERROR(1005, "上传图片失败"),
    UPLOAD_IMAGE_TYPE_ERROR(1006, "上传图片失败,数据不合法"),
    ERROR_WRAPPER_FIELD(1007, "包装字典属性失败"),

    /**
     * 直播错误,6xxx
     */

    /**
     * 用户错误,9xxx
     */
    USER_NOT_LOGIN(9999, "用户未登录"),
    USER_ACCESS_ERROR(9998, "非法请求"),
    USER_NOT_REGISTER(9997, "用户未注册"),
    LOGIN_CIPHER_ERROR(9996, "登录密码不正确"),
    USER_LOGIN_ERROR(9995, "用户登录失败"),
    USER_LOGOUT_ERROR(9994, "用户登录失败"),
    USER_ALREADY_EXIST(9993, "该手机号已经注册"),
    USER_NEED_REALNAME_APPLY_FOR(9992, "您需要实名认证"),
    USER_NEED_REALNAME_AUDIT(9991, "实名认证审核中请稍后"),
    PAY_CIPHER_ERROR(9990, "交易密码不正确"),
    PAY_CIPHER_NOT_EXIST(9989, "交易密码密码未设置"),
    PAY_CIPHER_EXIST(9988, "交易密码已经设置"),
    LACK_OF_BALANCE(9801, "用户余额不足,请先充值!"),
    ORIG_LOGIN_CIPHER_ERROR_2(9987, "原登陆密码不正确"),
    INVITE_CODE_ERROR(9986, "您输入的邀请码不正确,请确认邀请码"),
    USER_NO_REAL_NAME_ERROR(9985, "请您先做实名认证"),
    ID_CARD_ERROR(9984, "身份证号码不正确"),
    LOGIN_CIPHER_EQUALS_ERROR(9983, "新密码不能与旧密码相同"),
    ORIG_LOGIN_CIPHER_ERROR(9982, "原支付密码不正确"),
    USER_CARD_EXIST(9981, "用户已经绑定该卡"),
    OTHER_USER_CARD_EXIST(9980, "其他用户已经绑定该卡"),
    WITHDRAW_REALNAME_INFO_ERROR(9979, "提现账号实名信息不符"),
    USER_CARD_ERROR(9978, "提现卡信息不正确"),
    DEL_REALNAME_ERROR(9977, "解除实名失败"),
    UPLOAD_IDCARD_ERROR(9976, "上传身份证失败"),
    SAVE_IDCARD_ERROR(9975, "保存实名信息失败"),
    USER_ALREADY_REALNAME_ERROR(9974, "该用户已经实名认证"),
    USER_CONFIRM_REALNAME_ERROR(9973, "确认用户实名失败"),
    /**
     * 交易错误,8xxx
     */
    ORDERSTATUSERROR(8001, "订单状态不对"),
    YUEBUZU(8002, "余额不足"),
    OEDERNOTEXIST(8003, "订单不存在"),
    ORDERBELONGERROR(8004, "订单不属于当前用户"),
    CANCEL_BUY_TUIKUAI_ERROR(8005, "买入撤销退款失败"),
    CANCEL_BUY_UPORDERSTATUS_ERROR(8006, "买入撤销修改订单状态失败"),
    OFFEROVERTIME(8007, "报价已过期"),
    PAYOVERTIME(8008, "支付已过期"),
    NUMBERERROR(8009, "卖出份数大于持有份数"),
    DAYTOOSHORT(8010, "至少持有5天"),
    AFTERNINECLOCK(8011, "9点之后才能卖出"),
    MINAMOUNT(8012, "抱歉，该产品最低询价额为%s元"),
    NOTFINDCONFIG(8013, "找不到系统参数!"),
    CANNOUCANCEL(8014, "订单已受理，不能取消!"),
    NOINVITEUSER(8015, "找不到对应推荐人!"),
    CODENOTMATCHNAME(8016, "股票代码和股票名称不匹配"),
    STOCKMAYBEDOWN(8017, "该股票可能已经停牌"),
    STOCKNOTFOUND(8018, "没有找到对应的股票或已停牌，请更改后重试！"),
    RECHARGE_ORDER_TYPE_ERROR(8019,"该订单不是充值订单"),
    TURN_MANUAL_ERROR(8020, "只有已受理的订单才能转人工处理!"),
    TURN_MANUAL_FAILURE(8021, "转人工处理失败!"),
    MAXAMOUNT(8022, "抱歉，该产品最高询价额为%s元"),

    HAS_DEALED(8100, "该批次号已经处理过了！"),
    DATA_ISNULL(8101, "导入数据为空，请查看后再上传！"),
    FILETYPE_ERROR(8102, "文件格式不正确！"),
    XLS_FORMAT_ERROR(8103, "导入数据格式不对或者缺失，请检查后再导!"),
    MONEY_MINUS(8104,"盈亏金额不能小于0"),
    FILETYPE_DATE_ERROR(8105,"导入数据的到期日不正确"),
    PAY_METHOD_ERROR(8201, "支付方式不正确!"),
    TRADE_AMOUNT_ERROR(8202, "请输入正确的金额!"),
    TRADE_PARAM_ERROR(8203, "支付参数错误!"),
    TRADE_SIGN_ERROR(8204, "验签失败!"),
    TRADE_NOTIFY_ORDER_NOT_EXIST(8205, "交易订单不存在!"),
    RECHARGE_TRADE_ERROR(8206, "充值交易失败!"),
    TRADE_NOTIFY_ORDER_AMOUNT_ERROR(8207, "回调金额不正确!"),
    WITHDRAW_TRADE_AMOUNT_ERROR_MAX(8208, "用户余额不足!"),
    WITHDRAW_TRADE_ERROR(8209, "提现交易失败!"),
    USER_ORDERINFO_ERROR(8210, "订单和用户不匹配!"),
    FEE_AMOUNT_ERROR(8211, "提现手续费错误!"),
    WITHDRAW_BANKCARD_ERROR(8212, "请添加银行卡!"),
    NOT_FIND_INFO_ERROR(8301, "当前没有查询到信息!"),
    NOT_FIND_BROKEN_ERROR(8302, "找不到券商信息，请先完善券商信息!"),
    NOT_FIND_ORDER_ERROR(8303, "找不到需要处理的订单信息!"),
    NOT_CORRECT_DATE(8304, "日期格式错误!"),
    FEE_SETTING_ERROR(8305, "系统设置问题，请联系客服!"),
    /**
     * 直播错误,6xxx
     */

    /**
     * 文章错误,7xxx
     */
    ARTICLE_ERROR(7000, "参数有误"),;

    private Integer code;

    private String message;

    BizExceptionEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}